package com.java.thread.effective;

/**
 * User: wujun
 * Date: 2014/12/9
 */
public class RealWorker extends Worker {
    private int parentNum;

    public RealWorker(int parentNum) {
        this.parentNum = parentNum;
    }

    @Override
    public void run() {
        int num = reportNum();
        logger.debug("I am {} -> {} real worker.", parentNum, num);
        while (true) {
            try {
                Thread.sleep(15000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            logger.debug("I am {} -> {} real worker. Alive.", parentNum, num);
        }
    }
}